<%
from portal.lib.menu import spectacles, evenements
	
def print_spectacles(spectacles = None):
	if spectacles is not None:	
		i = 0
		x = ''
		for id, title in spectacles.iteritems():	
			i = i+1
			x = x + "<li "			
			if i == len(spectacles):
				x = x + ' style="border:none;" ' 
			x = x + ">"
			x = x + '<a href="/spectacles/view/%s">%s</a></li>' % (id, title)
   		return x
 
def print_evenements(evenements = None):
	if evenements is not None:	
		i = 0
		x = ''
		for id, name in evenements.iteritems():	
			i = i+1
			x = x + "<li "			
			if i == len(evenements):
				x = x + ' style="border:none;" ' 
			x = x + ">"
			x = x + '<a href="/evenement/view/%s">%s</a></li>' % (id, name)
   		return x
  	
%>
<div id="menu">
	<ul>
		<li><a href="/">Accueil</a></li>
			
		<li><a href="/compagnie">Compagnie</a>
			<ul>
				<li><a href="/compagnie/presentation">Présentation</a></li>
				<li><a href="/compagnie/equipe">Equipe</a></li>
				<li style="border:none;"><a href="/compagnie/programmation">Programmation</a></li>
			</ul>
		</li>
		<li><a href="/spectacles">Spectacles</a>
			<ul>
				${print_spectacles(spectacles = spectacles()) | n}
			</ul>
		</li>
		<li><a href="/evenement">Evènements</a>
			<ul>
				${print_evenements(evenements = evenements()) | n}
			</ul>
		</li>
		<li><a href="/ecole/ecole">Ecole</a>
			<ul>
				<li><a href="/ecole/professeur">Professeurs</a></li>
				<li><a href="/ecole/cours">Cours</a></li>
				<li style="border:none;"><a href="/ecole/palmares">Palmarès</a></li>
			</ul>
		</li>
		<!--<li><a href="/presse">Presse</a>
			<ul>
				<li><a href="/presse/compagnie">Compagnie</a></li>
				<li><a href="/presse/spectacles">Spectacles</a></li>
				<li  style="border:none;"><a href="/presse/ecole">Ecole</a></li>
			</ul>
		</li>-->
		<!--<li><a href="/forum">Forum</a></li>-->
		<!--<li><a href="/goldenbook">Livre d'or</a></li>-->
		<li style="border:none;"><a href="/contact">Contacts</a></li>
	</ul>	
</div>